/**
*Title:Debug JavaScript for Gadget
*Author: littlepower
*Function: Print special message in special 'div' element
*Parameter: (flag, msg, div_Id)
*/

function debugInfo(flag, msg, div_Id) {
    // A closure for print function of debug	
	// Outputs debug messages if debug flag has a non-zero value
    function print(flag, msg, div_Id) {      
      if (flag) {
       debug_html = msg;
       // Write debug HTML to div
       document.getElementById(div_Id).innerHTML = debug_html;
      }
    }
}